package com.kedacom.freedomLabel.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Utils {
    private static SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());

    public static String toArrayString(Object[] arr) {
        StringBuilder temp = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            if (i == 0) {
                temp.append(arr[i].toString());
            } else {
                temp.append(",").append(arr[i].toString());
            }
        }
        return temp.toString();
    }

    public static String millToString(long millsecond) {
        if (millsecond == 0) {
            return "";
        }
        return sdf1.format(new Date(millsecond));
    }
}
